"init" option to copy in a custom docker-compose.override.yml file#285
"init" option to copy in a custom docker-compose.override.yml file#285Philip-21 wants to merge 7 commits intohyperledger:mainfrom
Conversation
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
|
The E2E tests are failing with this error: |
internal/stacks/stack_manager.go
Outdated
| if err := s.copyToDockerComposeOverride(options.CustomPath); err != nil { | ||
| return fmt.Errorf("failed to copy file data to docker-compose.override.yml: %s", err) | ||
| } |
There was a problem hiding this comment.
I think you need a check around this to see if options.CustomPath has been set or not. Right now the tests seem to indicate that the CLI fails to initialize a stack if this flag is not set.
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
|
@nguyer I have corrected it, all checks pass successfully, and the docker -override works |
Signed-off-by: Philip Obiora <73377830+Philip-21@users.noreply.github.com>
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
internal/stacks/stack_manager.go
Outdated
| if err := s.writeDockerComposeOverride(compose); err != nil { | ||
| return fmt.Errorf("failed to write docker-compose.override.yml: %s", err) | ||
| } | ||
| if options.CustomPath == "docker-compose.yml" { |
There was a problem hiding this comment.
I think this check now enforces that you can only ever pass in a file named docker-compose.yml in the current directory. I would think we would just want to check to see if this is an empty string here (and then maybe validate the file exists).
| dockerPath := filepath.Join(s.Stack.StackDir, dockerComposePath) | ||
| overrideComposeContent, err := os.ReadFile(dockerPath) |
There was a problem hiding this comment.
If I'm reading this right, this means we will read the automatically generated docker-compose.override.yml, append it to a comment, and write it back out again to the same file.
From my understanding the goal here is to allow the user to pass in a yaml file from anywhere on their system, and we will use that as or merge it with the existing docker-compose.override.yml file. I'm not sure this function actually creates any new functionality as-is.
Signed-off-by: Philip-21 <philipuzomaobiora@gmail.com>
|
Hi @nguyer is this pr still open or i should close it ? |



This is pr fixes for #184